#ifndef __BOARD_H__
#define __BOARD_H__

#include "Support.h"
#include "Cell.h"
#include "Line.h"

class CBoard
{
private:
	CCell **m_map;
	CLine *m_line;
	int m_size;
	GPoint2D m_current_position;
	int m_number_of_line;
	char m_key_status;

	bool m_is_completed;
public:
	void Init (char *map, int size = 6);
	void Release ();

	void CheckKeyUp ();
	void CheckKeyDown ();
	void CheckKeyLeft ();
	void CheckKeyRight ();
	void CheckOtherKey ();

	int GetLine (char type);
	void ClearLine (GPoint2D point);
	CCell GetCell (GPoint2D point);

	bool PointCompare (GPoint2D point1, GPoint2D point2);
	void UpdateBoard ();
	bool IsWin ();
	bool IsComplete ();

	void Update ();
	void Draw ();
};

#endif